import { createRouter, createWebHashHistory } from 'vue-router'

const routes = [
  {
    path: '/',
    name: 'index',
    component:()=>import('@/views/index.vue'),
  },
  {
    path: '/board1',
    name: 'board1',
    component:()=>import('@/views/board1.vue'),
  },
  {
    path: '/board2',
    name: 'board2',
    component:()=>import('@/views/board2.vue'),
  },
  {
    path: '/board3',
    name: 'board3',
    component:()=>import('@/views/board3.vue'),
  },
]

const router = createRouter({
  history: createWebHashHistory(),
  routes,
  scrollBehavior (to, from, savedPosition) {
    // if (savedPosition) {
    //   //此处意思 即若回退页面，返回savedPosition，且页面不置顶
    //   return savedPosition
    // } else {
    //   //此处意思 若页面跳转新页面，则页面置顶
      // return { left: 0, top: 0}
    // }
  }
})

export default router
